import Rectangle from './Rectangle'

// const skyDom = document.querySelector('.sky')
// const skyStyles = getComputedStyle(skyDom)
// const skyWidth = parseFloat(skyStyles.width)
// const skyHeight = parseFloat(skyStyles.height)

class Sky extends Rectangle {
  constructor(skyDom) {
    const skyStyles = getComputedStyle(skyDom)
    const skyWidth = parseFloat(skyStyles.width)
    const skyHeight = parseFloat(skyStyles.height)
    super(skyWidth, skyHeight, 0, 0, -50, 0, skyDom)
  }

  onMove() {
    if (this.left <= -this.width / 2) {
      this.left = 0
    }
  }
}

export default Sky
